fix(ding): release vanished archived FIFO ownership - #152
Merged
schickling merged 2 commits intoAug 3, 2026
Conversation
agent-tool: Codex agent-tool-version: 0.145.0 agent-runtime: Codex 0.145.0 agent-session-lookup: unavailable tooling-profile: dotfiles@unknown-dirty
schickling-assistant
marked this pull request as ready for review
August 3, 2026 12:17
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 701d3dbc09
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
agent-tool: Codex agent-tool-version: 0.145.0 agent-runtime: Codex 0.145.0 agent-session-lookup: unavailable tooling-profile: dotfiles@unknown-dirty
This was referenced Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A staged DING notice can remain the FIFO head after its inbox message is archived, even when a maintained adapter later proves that the exact owned payload is no longer retained. Later unread messages then receive no transport while the target and sidecar remain healthy.
Goal
Release only an archived staged head after positive maintained-adapter absence, then advance later FIFO work without re-pasting the vanished notice or weakening fail-closed handling.
Decisions
NotRetainedas positive evidence from a maintained adapter that successfully parsed the live composer. Missing, unreadable, unrecognized, and timeout evidence remainsUnproven.flush_pendingreleasesNotRetainedonly for an archived message or recovery notice.NotRetained, preventing a later fresh re-paste.RetainedBlockedandUnprovenremain staged.Verification
ReceiptState::NotRetainedandPokeOutcome::NotRetaineddid not exist.rustfmt --check: passed.cargo test --lib ding::tests::: 30 passed, 0 failed.cargo test --test invariants: 1 passed, 0 failed.8f112ebe: RED; accepted-receipt control: GREEN.701d3dbarchived-only E2E: GREEN. The initial recovery transported once with zero acceptance; after A was archived, a healthy CodexNotRetainedreceipt released A and B transported and was accepted exactly once.NotRetained, unread release, archived retention, andRetainedBlockedrelease.3b6f2ef927cee59bc8ead6219b6059b65da5362292850a3f7c480f091bf2de23.tests/materialize.rs:700because its subprocess cannot findgit.The regression tests prove that archived positive absence advances message B exactly once without re-pasting A; unread positive absence keeps A staged and B at zero; unknown and retained-blocked evidence keep B at zero.
Complexity
One receipt variant and one queue-policy branch; no new dependency, file, transport, timer, persistence layer, or abstraction boundary.
Concerns
NotRetainedis only as sound as each maintained adapter's live-composer parser. Screens that cannot be located or parsed remainUnproven, preserving the fail-closed boundary.Friction & bottlenecks
The current Nix devshell's full-tree rustfmt proposes inherited unrelated formatting changes. The four changed Rust files pass formatting, and the full-tree base/candidate output is byte-identical after normalizing checkout paths. Strict clippy and the full test suite also have causally matched inherited failures described above; neither failure touches Ding.
Follow-ups
Durable or replayable staged ownership remains out of scope. The harness-neutral adapter seam overlaps with #123 but is not reworked here.
References
Closes #151
Reproduction: https://github.com/schickling-repros/2026-08-st2-staged-fifo-head-blocking/tree/8f112ebe0b96632fc57d2222b808955a9bbdac60
Refs #123